package cn.xttc.edu.handler;

import com.soecode.wxtools.api.IService;
import com.soecode.wxtools.api.WxMessageHandler;
import com.soecode.wxtools.bean.WxXmlMessage;
import com.soecode.wxtools.bean.WxXmlOutMessage;
import com.soecode.wxtools.exception.WxErrorException;

import java.util.Map;

/**
 * 处理用户发送消息
 * @author yl
 */
public class MyMessageHandler implements WxMessageHandler {
    @Override
    public WxXmlOutMessage handle(WxXmlMessage wxXmlMessage, Map<String, Object> map, IService iService) throws WxErrorException {
        String welcome = "欢迎您使用极安物流预约服务，如果您是客户，请点击下方菜单栏的“客户业务”；如果您是司机，请点击下方菜单栏的“司机业务”";
        return WxXmlOutMessage.TEXT().content(welcome).toUser(wxXmlMessage.getFromUserName()).fromUser(wxXmlMessage.getToUserName()).build();
    }
}
